#include "WiredTriangle.h"

WiredTriangle::WiredTriangle()
{
}

WiredTriangle::WiredTriangle(QList<QPoint*> vertexs)
{
    m_vertexs = vertexs;
}

WiredTriangle::WiredTriangle(QList<QPoint*> vertexs, QList<QColor*> colors)
{
    m_vertexs = vertexs;
    m_colors = colors;
}

void WiredTriangle::draw(QPainter * painter)
{
    QPoint* p1 = vertexs().at(0);
    QPoint* p2 = vertexs().at(1);
    QPoint* p3 = vertexs().at(2);

    Line l1(p1,p2);
    l1.setColors(colors().mid(3,1) << colors().mid(3,1));
    l1.draw(painter);

    Line l2(p1,p3);
    l2.setColors(colors().mid(3,1) << colors().mid(3,1));
    l2.draw(painter);

    Line l3(p2,p3);
    l3.setColors(colors().mid(3,1) << colors().mid(3,1));
    l3.draw(painter);
}
